IF (BUILD_PLAYERCC)
    INCLUDE_DIRECTORIES (${PROJECT_SOURCE_DIR}/client_libs ${PROJECT_BINARY_DIR}/client_libs)

    SET (srcs camera.cc)
    SET (boostSrcs example1.cc example3.cc)
    SET (boostSigSrcs example2.cc)

    IF (NOT HAVE_GETOPT)
        SET (playerreplaceLib playerreplace)
    ENDIF (NOT HAVE_GETOPT)

    ADD_DEFINITIONS (${PLAYERCC_DEFINITIONS})
    INCLUDE_DIRECTORIES (${PLAYERCC_EXTRA_INCLUDE_DIRS})
    LINK_DIRECTORIES (${PLAYERCC_EXTRA_LINK_DIRS})
    MACRO (PLAYERCPP_ADD _name)
        ADD_EXECUTABLE (${_name} ${ARGN})
        TARGET_LINK_LIBRARIES (${_name} playerc++ playerc playerinterface playercommon
                               ${playerreplaceLib} ${PLAYERC_EXTRA_LINK_LIBRARIES}
                               ${PLAYERCC_EXTRA_LINK_LIBRARIES})
        IF (PLAYER_OS_SOLARIS)
            TARGET_LINK_LIBRARIES (${_name} rt)
        ENDIF (PLAYER_OS_SOLARIS)
    ENDMACRO (PLAYERCPP_ADD _name)

    PLAYERCPP_ADD (camera camera.cc)    
    INSTALL (FILES ${srcs} DESTINATION ${PROJECT_SOURCE_DIR}/bin)

    IF (BUILD_PLAYERCC_BOOST)
      IF (HAVE_BOOST_THREAD AND HAVE_BOOST_SIGNALS)
          PLAYERCPP_ADD (example1 example1.cc)
          INSTALL (FILES ${boostSrcs} DESTINATION ${PROJECT_SOURCE_DIR}/bin)
      ENDIF (HAVE_BOOST_THREAD AND HAVE_BOOST_SIGNALS)

      IF (HAVE_BOOST_SIGNALS)
          PLAYERCPP_ADD (example2 example2.cc)
          INSTALL (FILES ${boostSigSrcs} DESTINATION ${PROJECT_SOURCE_DIR}/bin)
      ENDIF (HAVE_BOOST_SIGNALS)
    ENDIF (BUILD_PLAYERCC_BOOST)

    # Install the example CMakeLists.txt
    SET (cameraCMakeLists_in ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt.camera.in)
    SET (cameraCMakeLists ${CMAKE_CURRENT_BINARY_DIR}/CMakeLists.txt.camera)
    CONFIGURE_FILE (${cameraCMakeLists_in} ${cameraCMakeLists} @ONLY)
    INSTALL (FILES ${cameraCMakeLists} DESTINATION ${PROJECT_SOURCE_DIR} RENAME CMakeLists.txt)
    INSTALL (FILES README DESTINATION ${PROJECT_SOURCE_DIR})
ELSE (BUILD_PLAYERCC)
    MESSAGE (STATUS "playerc++ camera will not be built - playerc++ client library is disabled")
ENDIF (BUILD_PLAYERCC)
